<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '申请列表';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="loan-index">

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'name',
            'mobile',

            [
                'attribute' => 'sex',
                'value' => function($data) {
                    if ($data->sex == 1) {
                        return '男';
                    } else if ($data->sex == 2) {
                        return '女';
                    } else {
                        return '性别填写有误';
                    }
                }
            ],

            'loan_amount',
             'loan_time',
             'loan_purpose',
            'remark',
            // 'ip',
             'create_time:datetime',
            // 'update_time:datetime',
            // 'status',

            [
                'class' => 'yii\grid\ActionColumn',
                'template' => '{view} {delete}'
            ],
        ],
    ]); ?>
</div>
